function getDistance($adresse1,$adresse2) {
	$url='http://maps.google.com/maps/api/directions/xml?language=fr&origin='.$adresse1.'&destination='.$adresse2.'&sensor=false';
	$xml=file_get_contents($url);
	$root = simplexml_load_string($xml);
	$distance=$root->route->leg->distance->value;
	$duree=$root->route->leg->duration->value;
	$etapes=$root->route->leg->step;
	return array(
		'distanceEnMetres'=>$distance,
		'dureeEnSecondes'=>$duree,
		'etapes'=>$etapes,
		'adresseDepart'=>$root->route->leg->start_address,
		'adresseArrivee'=>$root->route->leg->end_address
	);
}

